﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL.Interfaces;

namespace DAL.Repository
{
    public class PromotionRepository : IPromotionRepository,IRepository<Promotion>
    {
        public void Add(Promotion t)
        {
            var entity = new PromotionEntities();
            entity.AddToPromotions(t);
            entity.SaveChanges();
        }


        public void Update(Promotion t)
        {
            var entity = new PromotionEntities();
            entity.ObjectStateManager.ChangeObjectState(t, System.Data.EntityState.Modified);
            entity.SaveChanges();
        }
    }
}
